package br.fatec.ads.decorator;

import org.displaytag.decorator.TableDecorator;

import br.fatec.ads.model.Usuario;
import br.fatec.ads.model.Vaga;

public class VagaDecorator extends TableDecorator {
	public String getAtivoDescricao(){
		Vaga vaga = (Vaga) getCurrentRowObject();
		
		return vaga.getAtivo().equals("S") ? "Ativo" : "Inativo";
	}
	
	public String getLinkVagaConsultar(){
		Vaga vaga = (Vaga) getCurrentRowObject();
		
		String link = "<img src=\"img/grid_pesquisar.jpg\" " +
				"onclick=\"window.location='VagaConsultar?idVagaConsultar=" + vaga.getIdVaga() + "'\" " +
						"style=\"cursor: pointer;\">";
		return link;
	}
	
	public String getLinkVagaAlterar(){
		Vaga vaga = (Vaga) getCurrentRowObject();
		
		String link = "<img src=\"img/grid_alterar.jpg\" " +
				"onclick=\"window.location='VagaAlterar?idVagaAlterar=" + vaga.getIdVaga() + "'\" " +
						"style=\"cursor: pointer;\">";
		return link;
	}
	
	public String getLinkVagaExcluir(){
		Vaga vaga = (Vaga) getCurrentRowObject();
		
		String link = "<img src=\"img/grid_excluir.jpg\" " +
				"onclick=\"window.location='VagaExcluir?idVagaExcluir=" + vaga.getIdVaga() + "'\" " +
						"style=\"cursor: pointer;\">";
		return link;
	}
}